package com.atguigu.wordcount.groupcomparator;

import org.apache.hadoop.io.WritableComparable;
import org.apache.hadoop.io.WritableComparator;

/**
 * @ClassName MySort
 * @DeScription MyGroupComparator
 * @Author 剧情再美终是戏
 * @Date 2019/11/19 9:30
 * @Version 1.0
 **/
public class MyGroupComparator extends WritableComparator {

    public MyGroupComparator() {
        super(Order.class, true);
    }

    @Override
    public int compare(WritableComparable a, WritableComparable b) {
        Order o1 = (Order) a;
        Order o2 = (Order) b;
        return o1.getId().compareTo(o2.getId());
    }
}
